package cn.edu.scau.cmi.dengzejun.chapter08;

public class Example8_6 {
	public static void main(String args[]) {
		CargoBoat ship=new CargoBoat();
		ship.setMaxConent(1000);
		int m=600;
		try {
			ship.loading(m);
			m=400;
			ship.loading(m);
			m=467;
			ship.loading(m);
			m=555;
			ship.loading(m);
		}
		catch(DangerException e) {
			System.out.println(e.warnMess());
			System.out.println("We don't load "+m+" tons goods.");
		}
		finally {
			System.out.println("the ship will leave in time.");
		}
		return;
	}
}
